<template>
  <div>
    <h1>foo</h1>
    <button @click="goBack">回退</button>
    <button @click="goToChild()">go to foo_children</button>
    <router-view></router-view>
  </div>
</template>
<script>
export default {
  methods: {
    goBack () {
      window.history.length > 1 ? this.$router.go(-1) : this.$router.push('/foo')
    },
    goToChild () {
      this.$router.push('/foo/foo_children')
    }
  }
}
</script>
